<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %>
<%@ page import="java.text.SimpleDateFormat"%>
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="com.lmpop.trade.ti_brand.Ti_brandInfo" %>
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page" /> 
<%  
   
   Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo();
   Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
   Ti_brandInfo  ti_brandInfo = new  Ti_brandInfo();
  
   String ordersource = tb_commparaInfo.getSelectItem("16",""); 
   String s_cat_all = ts_categoryInfo.getSelCatByTLevel("2","1");
   String s_brand_all = ti_brandInfo.getBrandSelectAll(""); 
   List plist = tb_commparaInfo.getListByParamAttr("25");  
   String invoice_no = tb_commparaInfo.getSelectItem("21","");
   String invoice_top = tb_commparaInfo.getSelectItem("22","");
   String invoice_content = tb_commparaInfo.getSelectItem("23","");
 
   
   //create order no   
   String order_no = randomId.GenOrderId();
	


%>
<html>
  <head>
    <title>新增订单</title>
	  <link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
      <link href="/program/admin/index/css/thickbox.css" rel="stylesheet" type="text/css">
      <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_areaInfo.js'></script>
      <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	  <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	   
	 <script type="text/javascript" src="/js/jquery.js"></script>
	 <script type="text/javascript" src="/js/thickbox.js"></script>
	 <script type="text/javascript" src="js_order.js"></script>
	 <script type="text/javascript" src="js_area.js"></script>
    <script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
    <script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
     <script>
        jQuery.noConflict();
     </script> 
	
     <style>
     .button_s_css{height:20px; width:55px; font-size: 12px; color: #fff; border: 1px #cabca3 solid; 
               background:url(/program/admin/index/images/an_01.gif) repeat-x; cursor:pointer;padding:0 3px 0 3px;}
    </style>
 

</head>

<body>
	<h1>新增订单</h1>
	
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
			 
		 <tr>
				<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">基本信息</span>			</td>
	   </tr>
    <tr>
			<td align="right" width="20%">订单来源<font color="red">*</font></td>	   
			 <td colspan="3">
		     <select name="order_source" id="order_source">
                 <option value="">请选择</option>         
         	     <%=ordersource%>
              </select>					 
		    </td>
			
	  </tr>
   
      <tr>
			<td align="right" width="20%">
				 支付方式<font color="red">*</font>		
			</td>
			<td colspan="3">
				    <input name="zhifu" id="zhifu" class="button_s_css" type="button" value="选择" onclick="showAjaxContent('p');"/>			 
			      <div id="py_show_table"></div>				 
			 </td>
		</tr>
     <tr>
		<td  colspan="4">
		   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">收货人信息</span>			
		  </td>
	   </tr>
       
     <tr>
			  <td align="right" width="20%">收货人<font color="red">*</font></td>	   
			  <td width="18%">
			       <input name="consignee" id="consignee" type="text" value="" maxlength="60" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />			 
			  </td>
			  <td width="12%" align="right">电子邮件<font color="red">*</font></td>
			  <td width="60%">
             <input name="email" id="email" type="text" value="" maxlength="60" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />		  
			   </td>
	  </tr>
      
      <tr>
			  <td align="right" width="20%">邮编<font color="red">*</font></td>	   
			  <td width="18%">
			       <input name="zip_code" id="zip_code" type="text" value="" maxlength="10" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />			 
			  </td>
			  <td width="12%" align="right">地区<font color="red">*</font></td>
			  <td width="60%">
         
          <select name="province" id="province" onclick="setCitys(this.value)">
				  <option value="">省份</option> 
				</select>
				<select name="eparchy_code" id="eparchy_code" onclick="setAreas(this.value)">
				  <option value="">地级市</option> 
				 </select>
				<select name="city_code" id="city_code" style="display:inline" >
				 <option value="">市、县级市、县</option> 
				</select>
    
			   </td>
	  </tr>
      <tr>
			<td align="right" width="20%">
				 详细地址<font color="red">*</font>		
			</td>
			<td colspan="3">
				 <input type="text" name="address" id="address" size="65" maxlength="200" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />
			 </td>
		</tr>
   
    <tr>
			  <td align="right" width="20%">手机<font color="red">*</font></td>	   
			  <td width="18%">
			       <input name="cellphone" id="cellphone" type="text" value="" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />			 
			  </td>
			  <td width="12%" align="right">电话<font color="red">*</font></td>
			  <td width="60%">
            <input name="tel" id="tel" type="text" value="" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />			  
			   </td>
	  </tr>
   
    <tr>
			  <td align="right" width="20%">标志性建筑<font color="red">*</font></td>	   
			  <td width="18%">
			       <input name="sign_building" id="sign_building" type="text" value="" maxlength="60" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " />			 
			  </td>
			  <td width="12%" align="right">送货时间<font color="red">*</font></td>
			  <td width="60%">
            <input name="best_time" id="best_time" type="text" value="" maxlength="60" onclick="WdatePicker({maxDate:'#F{$dp.$D({d:-1})}',readOnly:true})" />			  
			   </td>
	  </tr>
     
     
     <tr>
				<td  colspan="4">
			    &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">商品信息</span>			
			  </td>
	   </tr>
 
       
     </tr>
      <tr>
			<td align="right" width="20%">
				 添加商品<font color="red">*</font>		
			</td>
			<td colspan="3">
     <select name="g_cat_id" id="g_cat_id">
        <option value="">所有分类</option>
         <%=s_cat_all%>									  
     </select>
	 <select name="g_brand_id" id="g_brand_id" >
		 <option value="">所有品牌</option>
		 <%=s_brand_all%>	
	</select>
				<input type="text" name="g_keyword" id="g_keyword"/>
				<input type="button" class="button_s_css" value=" 搜索 "  onclick="showAjaxContent('g')" />
				<div id="show_goods_table"></div>		
			</td>
		</tr>
		
       <tr>
				<td  colspan="4">
			    &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">其他信息</span>			
			  </td>
	   </tr>
 
       

      <tr>
	     <td align="right" width="20%">
				  包装方式
			</td>
			<td colspan="3">
				 
				<%
                 		  
						  if(plist !=null && plist.size()>0){
                 		   for(int m=0;m<plist.size();m++){	
                 		   Hashtable pMap =(Hashtable)plist.get(m);
						   String param_id="",para_code2="",para_code1="",para_code3="",remark="";
						   if(pMap.get("param_id")!=null)
						   {
							  param_id = pMap.get("param_id").toString();                      
						   }
						   if(pMap.get("para_code2")!=null)
						   {
							 para_code2 = pMap.get("para_code2").toString();                      
						   }
						   if(pMap.get("para_code1")!=null)
						   {
							 para_code1 = pMap.get("para_code1").toString();                      
						   }
						   if(pMap.get("para_code3")!=null)
						   {
							 para_code3 = pMap.get("para_code3").toString();                      
						   }
						            		   
                 		   				 
						 %>                 
                 
                       <input type="radio"  name="pack" id="<%=para_code3%>" value="<%=para_code2%>" onclick="setPack(this,'<%=param_id%>')" ><%=para_code1%>
								 
					 <%
                    }                  
                  }								 
	 			 %>    
                 
				 &nbsp;&nbsp;<span id="packshow"></span>
	              <input type="hidden" name="pack_fee" id="pack_fee" value="0">
				  <input type="hidden" name="pack_id" id="pack_id" value="">
		  </td>
		</tr>
		
		<tr>
		 <td align="right" width="20%">
				 是否索要发票
			</td>
			<td colspan="3">
			 
			  <input type="radio" name="invoice_radio" id="invoice_radio1" value="1" onclick="setinvoice(1)" checked/>否
              <input type="radio" name="invoice_radio" id="invoice_radio2" value="0" onclick="setinvoice(2)"  />是 
			  <table id="invoice_table" width="100%" border="0" cellspacing="0" cellpadding="0" style="display:none;">        
                  <tr>			        
            		   <td width="18%" height="35" align="right" style="background:#F9F9F9;">
			          	 	 发票抬头<font color="red">*</font>			          
			           </td>
			           <td width="48%" style="background:#F9F9F9;">
                   <input id="invoice_top" name="invoice_top" value="" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "> 
                  <span class="STYLE5"></span>
			          </td>
			          <td width="36%"></td>
					  	</tr>
                    <tr>				
                 <tr>			        
            		 <td width="18%" height="35" align="right" style="background:#F9F9F9;">
			          	 	 发票内容<font color="red">*</font>			          
			           </td>
			           <td width="48%" style="background:#F9F9F9;">
                    <select id="invoice_content" name="invoice_content">
					   <option value="">请选择</option>
					   <%=invoice_content%>              
                    </select>                    			         
               </td>
			          <td width="36%"></td>
					  	</tr>
			     </table>	
				 
		  </td>
		</tr>
		
		 <tr>
			<td align="right" width="20%">
				 配送方式<font color="red">*</font>		
			</td>
			<td colspan="3">
				    <input name="zhifu" id="zhifu" class="button_s_css" type="button" value="选择" onclick="setShippingfee();"/>			 
			      <div id="sp_show_table"></div>				 
			 </td>
		</tr>
		
		
		
		
		
		
		
		<tr>
		 <td align="right" width="20%">
				  给商家留言
			</td>
			<td colspan="3">
				   <textarea rows="4" cols="45" id="mem_message" name="mem_message" maxlength="300" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "   onbeforepaste= "clearSBC();"" onBlur="return isMaxLen(this)"></textarea>   				
		  </td>
		</tr>
		
		<tr>
		 <td align="right" width="20%">
				  缺货处理
			</td>
			<td colspan="3">
				  <input type="radio" name="how_oos" id="how_oos1" value="0" checked />等待所有商品备齐后再发 
				  <input type="radio" name="how_oos" id="how_oos2" value="1" />取消订单
				  <input type="radio" name="how_oos" id="how_oos3" value="2" />与店主协商						
		  </td>
		</tr>
     
		
		</table>
	
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="3029" />
				
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="subForm()"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
		
		
		<input name="order_state" id="order_state" type="hidden" value="0"/>
		
		<input name="pay_id" id="pay_id" type="hidden" value=""/>	
		<input name="pay_name" id="pay_name" type="hidden" value=""/>
		<input name="shipping_fee" id="shipping_fee" type="hidden" value="20"/>
    
		<input name="shipping_id" id="shipping_id" type="hidden" value=""/>	
		<input name="shipping_name" id="shipping_name" type="hidden" value=""/>
		<input name="area_attr" id="area_attr" type="hidden" value=""/>	
		
        <input name="if_need_invoice" id="if_need_invoice" type="hidden" value="1"/>	
        <input name="all_goods_num" id="all_goods_num" type="hidden" value=""/>	
		
		<input name="total_price" id="total_price" type="hidden" value=""/>	
		<input name="all_goods_weight" id="all_goods_weight" type="hidden" value=""/>	
		
	    <input type="hidden" id="tax_invoice" name="tax_invoice" value="0" />    
		
	  
	    <input name="all_order_detail" id="all_order_detail" type="hidden" value="" />	
		<input name="invoice_company" id="invoice_company" type="hidden" value="" />	

</form>
</body>

</html>
